package com.hoshiicloud.saleorder.feign;

import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.saleorder.dto.CartDTO;
import com.hoshiicloud.saleorder.feign.hystrix.HystrixMarketFeignFallback;
import com.hoshiicloud.saleorder.param.customer.CartDeleteParam;
import com.hoshiicloud.saleorder.param.customer.CartQueryParam;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author zhangshuhu
 * @title: IdGeneratorService
 * @projectName hoshiicloud
 * @description: 客户服务
 * @since 2019-05-10
 */
@Service
@FeignClient(name = "hoshiicloud-market", fallback = HystrixMarketFeignFallback.class)
public interface MarketService {

    /**
     * 获取购物车列表
     *
     * @param param
     * @return
     */
    @RequestMapping(value = "/cart/getList", method = RequestMethod.POST)
    Response<List<CartDTO>> getList(@RequestBody CartQueryParam param);

    /**
     * 批量删除购物车记录
     */
    @RequestMapping(value = "/cart/deleteByIds", method = RequestMethod.GET)
    Response deleteCartByIds(@RequestBody List<Long> ids);

    /**
     * 删除购物车记录-立即购买方式
     */
    @RequestMapping(value = "/cart/deleteByNumber", method = RequestMethod.POST)
    Response deleteByNumber(@RequestBody CartDeleteParam param);

}
